require 'warden'
require 'sinatra'

module AuthHelpers
    def warden_handler
        env['warden']
    end

    def check_authentication
        unless warden_handler.authenticated?
            redirect to('/unauthenticated')
        end
    end

    def current_user
        warden_handler.user
    end
end